<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- v-if,v-show -->
        <div v-if="isLogin">{{welcome}}</div>
        <div v-else>{{msg}}</div>
        <button v-if="isLogin" @click="isLogin=false">退出</button>
        <button v-else @click="click1">登录</button>

    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                isLogin:false,
                welcome:'欢迎使用',
                msg:'请登录'
            },
            methods: {
                click1(){
                    this.isLogin = true
                }
            }
        })
    </script>
</body>

</html>